﻿using System;
using Granite.Modeling.Internals;
using System.Diagnostics.CodeAnalysis;

namespace System
{
    /// <summary>
    /// Adds features that are missing from WP7
    /// </summary>
    static public class EnumExtension
    {
        /// <summary>
        /// Returns True is the indicated flag is set on the Enum.
        /// </summary>
        /// <param name="value"></param>
        /// <param name="flag"></param>
        /// <returns></returns>
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "Flag")]
        [SuppressMessage("Microsoft.Naming", "CA1726:UsePreferredTerms", MessageId = "flag")]
        static public bool HasFlag(this PropertySetModes value, PropertySetModes flag)
        {
            return (value & flag) != 0;
        }

    }
}
